/*
 * Copyright (c) 2009. Silenus Consultoria, S.L.
 */
package es.silenus.detecta.dao;

import es.silenus.detecta.model.User;

import java.util.List;


/**
 * User DAO interface.
 *
 * @author <a href="mailto:malonso@silenus-consultoria.es">Mariano Alonso</a>
 * @since 25-mar-2009 17:56:40
 */
public interface UserDAO extends ReadWriteDAO<User, Integer> {
	/**
	 * Finds a user by its login.
	 *
	 * @param login the login.
	 *
	 * @return the user or null.
	 */
	public User findByLogin(final String login);

	/**
	 * Finds a user by its user and password.
	 *
	 * @param login the login.
	 * @param password the password encoded/hashed as in database.
	 *
	 * @return the user or null.
	 */
	public User findByLoginAndPassword(final String login, final String password);

	/**
	 * Retrieves the organization administrators.
	 *
	 * @param organization the organization.
	 *
	 * @return the list of administrators.
	 */
	public List<User> getAdministrators(int organization);
}
